<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ include file="/common/includes.jsp" %>
<html>
 <head>
    <title>日报表</title>
	<%@ include file="/common/meta.jsp" %>
	<script src="${ctx}/js/ligerUI/js/plugins/ligerLayout.js" type="text/javascript"></script>
	<script src="${ctx}/js/jsp/comm.js" type="text/javascript"></script>
	<script type="text/javascript">
		var basic_Url="${ctx}/logic/Reports";
		var basic_WUrl="/logic/Reports";
		var grid;
		function createSearch(){
			init(1,11,'100,100,100,100,100,100,100,20,100,20,100','10%');
			//第一行的数据
			addCommon(0,0,"lable","物料编码：");
			addCommon(0,1,"txtlike","details.zd005MaterialsCode");
			addCommon(0,2,"lable","物料名称：");
			addCommon(0,3,"txtlike","details.zd005MaterialsName");
			addCommon(0,4,"lable","仓库：");
 			addCommon(0,5,"selectEnum","details.zd003WhName","<option></option><c:forEach var="s" items="${wh}"><option value='${s.zd003Name}'>${s.zd003Name}</option></c:forEach>");
			//addCommon(0,6,"lable","起始时间：");
			//addCommon(0,7,"datestart","details.bizCreatorDate");
		
		}
		
		function searchAP(){
			multipleSearch("#table1",true,"",basic_Url+"/dayreportlist.do");
		}
		document.onkeydown=keyListener;   
		function keyListener(e){   
		    e = e ? e : event;  
		    if(e.keyCode == 13){   
		    	searchAP();
		    }   
		}  	
		$(function(){
			grid = $("#table1").ligerGrid({
		        columns: [
		                  { display: '仓库编码', name: 'zd003WhCode', width: 100 },
		                  { display: '仓库名称', name: 'zd003WhName', width: 80},
		                  { display: '物料编码', name: 'zd005MaterialsCode', width: 100},
		                  { display: '物料名称', name: 'zd005MaterialsName', width:80},
		                  { display: '型号', name: 'zd007MaterialsModel', width:80},
		                  { display: '规格', name: 'zd006MaterialsSpec', width:80},
		                  { display: '颜色', name: 'zd008MaterialsColor', width:80},
		                  { display: '材质', name: 'zd008MaterialsQuanlity', width:80},
		                  { display: '单位', name: 'zd009BasicUnit', width:60},
		                  { display: 'PI号', name: 'zd020PiCode', width:60},
		                  { display: '当前库存', name: 'zd011BasicQuantity', width: 100,render: function (item){
		                		if(item.zd011BasicQuantity==''||item.zd011BasicQuantity==null||parseFloat(item.zd011BasicQuantity)==0){
		                			return '0.0';
		                		}
		                	 	return item.zd011BasicQuantity.toFixed(4);
		                  }},
		                  { display: '本日期初库存', name: 'beginningQuantity', width: 100,render: function (item){
		                	 if(item.beginningQuantity==''||item.beginningQuantity==null||parseFloat(item.beginningQuantity)==0){
		                			return (item.zd011BasicQuantity-item.outQuantity-item.inQuantity-item.cbQuantity).toFixed(4);
		                		}
		                	 	return item.beginningQuantity.toFixed(4);
		                  }},
		                  { display: '入库数量', name: 'inQuantity', width: 80,render: function (item){
		                		if(item.inQuantity==''||item.inQuantity==null||parseFloat(item.inQuantity)==0){
		                			return '0.0';
		                		}
		                	 	return item.inQuantity.toFixed(4);
		                  }},
		                  { display: '出库库存', name: 'outQuantity', width: 80,render: function (item){
		                		if(item.outQuantity==''||item.outQuantity==null||parseFloat(item.outQuantity)==0){
		                			return '0.0';
		                		}
		                	 	return item.outQuantity.toFixed(4);
		                  }},
		                  { display: '反审数', name: 'cbQuantity', width: 80,render: function (item){
		                		if(item.cbQuantity==''||item.cbQuantity==null||parseFloat(item.cbQuantity)==0){
		                			return '0.0';
		                		}
		                	 	return item.cbQuantity.toFixed(4);
		                  }}
		                  ],
		                  enabledEdit: true,
		                  usePager: true, rownumbers: true, 
		                  pageSize:50,
		                  pageSizeOptions :[50,60,70],
		                  url:basic_Url+"/dayreportlist.do",
		                  width: "100%", height:'100%',
		                  enabledSort:false
		                  });
			$("#pageloading").hide();
			});
		function exportExcel(){
		   	var filtersStr = generateCondition();
			var path = basic_Url+"/dayreportExcel.do?filters="+filtersStr+"&_search=true";
			window.open(path,"_blank");
		}
		</script>
	 
  </head>
 <body style="padding:10px" onload="createSearch()">  
       <div id="layout1">

          <div id="pageHeader" class="pageHeader">
               <div class="searchBar" id="multipleSearchDialog">
	                <table class="table" width="100%" id="searchHeader" >  
                        <tbody id="newbody">
                        </tbody>
 	                </table>
                    <div class="subBar">
			             <ul>
			            	<li><div class="buttonActive"><div class="buttonContent"><button type="submit" id="btnSearch" onclick="exportExcel()">导出Excel</button></div></div></li>
				             <li><div class="buttonActive"><div class="buttonContent"><button type="submit" id="btnSearch" onclick="searchAP()">查询</button></div></div></li>
				             <li><a class="button" onclick="clearSearch()"><span>重置</span></a></li>
			             </ul>
	                </div>
               </div>
          </div>
      </div>
      <div position="center" id="table1">
      </div>
      <div class="clear"></div>
    </body>
</html>